package domain.terrain;

import java.awt.Color;

import com.uqbar.vainilla.DeltaState;
import com.uqbar.vainilla.appearances.Rectangle;

import domain.components.Bullet;
import domain.components.WormsComponent;

public class SquareGround extends WormsComponent {

	public SquareGround(int aDiameter, int aHeight, double x, double y) {
		super(aDiameter, aHeight, x, y);
		this.setAppearance(new Rectangle(Color.BLACK, aDiameter, aHeight));
	}

	@Override
	public boolean isSolid() {
		return true;
	}

	@Override
	protected void onCollisionWithSolid(WormsComponent gc) {

	}

	@Override
	protected void defineCollide(WormsComponent gc) {
	}

	@Override
	protected void effectiveUpdate(DeltaState deltaState) {

	}

	@Override
	public boolean collideWithRect(WormsComponent comp) {
		return this.rectRectCollide(comp, this);
	}

	@Override
	public boolean collideWithCircle(WormsComponent comp) {
		return this.rectCircleCollide(comp,this);
	}

	@Override
	public boolean collisionNature(WormsComponent comp) {
		return comp.collideWithRect(this);
	}

	public void collideWithProyectile(Bullet bullet) {
		bullet.destroyComponent();
	}
}
